﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;


namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OUnsuitableProdSupper : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改, Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "OUnsuitableProdList"; }
        }

        /// <summary>
        /// 需要修改的用户ID
        /// </summary>
        protected int UnsuitabledID
        {
            get
            {
                return GetRequestValue<int>("UnsuitabledID", 0);
            }
        }
        private OUnsuitableProdInfo _obj;
        protected OUnsuitableProdInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = OUnsuitableProdController.GetById(UnsuitabledID);
                return _obj;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "upload")
            {
                addmenu();
            }
        }

        protected void addmenu()
        {
            string SupplerReplyFileName =GetRequestValue<string>("SupplerReplyFileName","");
            string SupplerReplyFilePath = GetRequestValue<string>("SupplerReplyFilePath", "");

            string ExcelJPFile = GetRequestValue<string>("ExcelJPFile", "");
            string ExcelJPFilePath = GetRequestValue<string>("ExcelJPFilePath", "");

          //  this.AddLog(Permission.新增, null, obj2);

            bool r = OUnsuitableProdController.AddSupplerReply(UnsuitabledID, SupplerReplyFileName, SupplerReplyFilePath, ExcelJPFile, ExcelJPFilePath);
            if (r)
                SuccessJson("添加文件成功", this.DWZRef);
            else
                ErrorJson("添加文件失败", this.DWZRef);
        }
    }
}